<template>
  <div class="app-container">
    <video class="background-video" src="/img/向往航天的女孩/Toy-Aeroplane.webm" autoplay loop muted playsinline></video>
    <RouterView />
    <BottomNav />
  </div>
</template>

<script setup>
import { RouterView } from 'vue-router'
import BottomNav from './components/BottomNav.vue'
import './assets/main.css'
</script>

<style scoped>
.app-container {
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-height); /* 使用全局变量定义底部导航高度 */
  padding-top: var(--spacing-md);
}

/* 桌面端移除底部导航占位空间 */
@media (min-width: 768px) {
  .app-container {
    padding-bottom: 0;
  }
}

.background-video {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
  z-index: -1;
  object-fit: cover;
}

.BottomNav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-index-nav);
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

/* 底部导航栏滚动效果 */
.BottomNav.hidden {
  transform: translateY(100%);
}

/* 页面过渡动画 */
.router-view-enter-active,
.router-view-leave-active {
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.router-view-enter-from,
.router-view-leave-to {
  opacity: 0;
  transform: translateY(10px);
}

/* 移除未使用的header和nav样式 */
#app {
  padding-top: env(safe-area-inset-top);
  min-height: 100vh;
  overflow-y: auto;
}
</style>
